local wdtx__nullificationSkill = fk.CreateSkill {
  name = "wdtx__nullification_skill",
}

wdtx__nullificationSkill:addEffect("cardskill", {
  name = "wdtx__nullification_skill",
  can_use = Util.FalseFunc,
  on_use = function(self,room, effect)
    if room.logic.class.name == "wdtx_logic" and effect.card:getMark("@@up_nullifi") > 0 then
      effect.disresponsiveList = room.players
    end
    room:delay(500)
    if room.current.id < 0 then
      local invokeplayer = table.find(room.alive_players,function(pr) return pr.id > 0 end) or room.alive_players[1]
      room:askToSkillInvoke(invokeplayer,{
        skill_name = "invokebynulli",
        prompt = "#invokebynulli",
      })
    end
  end,
  on_effect = function(self, room, effect)
    if effect.responseToEvent then
      effect.responseToEvent.isCancellOut = true
      local responfrom = effect.responseToEvent and effect.responseToEvent.from
      if responfrom and responfrom ~= effect.from and room.logic.class.name == "wdtx_logic" and effect.card:getMark("@@up_nullifi") > 0 then
        local from = responfrom
        room:setPlayerMark(from,"@@up_nullifi",1)
        room:handleAddLoseSkills(from, "prohTrickCardSkill", nil, false)
      end
    end
  end
})


return wdtx__nullificationSkill